package com.wjn.blog.familyblog.controller.view;

import com.wjn.blog.familyblog.bean.index.dto.*;
import com.wjn.blog.familyblog.bean.page.Pagination;
import com.wjn.blog.familyblog.common.utils.JsonResult;
import com.wjn.blog.familyblog.service.view.ViewIndexService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * @auther WJN
 * @date 2019/9/17 15:19
 * @describetion 首页控制器
 */
@RestController
@RequestMapping("index")
public class ViewIndexController {
    @Autowired
    private ViewIndexService viewIndexService;

    /**
     * 获取博客标题内容
     * @return
     */
    @GetMapping("getBLogs/{pageNum}")
    @ApiOperation(value = "博客标题内容")
    public JsonResult getBLogs(@PathVariable("pageNum") Integer pageNum){
        Pagination<BlogContentDto> blogContentDtoList = viewIndexService.getBLogs(pageNum);
        return JsonResult.success(blogContentDtoList);
    }


}
